const app = getApp()
let qCloud = require("../../index.js");

Page({
  /** 页面的初始数据 */
  data: {
    imgPath: qCloud.config.STATIC_IMAGE_PATH,
    produceTaskId: null, // 生产任务ID
    workReportApproval: {}, // 上数审批详情
  },
  /** 生命周期函数--监听页面加载 */
  onLoad: function (options) {
    this.setData({
      produceTaskId: options.produceTaskId
    });
    // 查询上数审批详情
    this.queryUpcountApprovalDetails();
  },
  // 查询上数审批详情
  queryUpcountApprovalDetails() {
    let self = this;
    let params = {
      produceTaskId: self.data.produceTaskId
    };
    app.fetchApis(self, qCloud.api.workreport_queryWorkReportApprovalDetails, params, "POST", function (e) {
      let result = e.data;

      if (result.code == 200) {
        self.setData({
          workReportApproval: result.data,
        });
      }
    });
  },
});
